count=0#记录抽数

mid_z=0#记录紫保底

mid_j=0#记录金保底

XH=0#记录星辉总数

weapen=0#记录四星武器总数

wai=0#记录歪了几次

chu=0#记录出了几个当期五星角色

jilu1=0#记录指示是大保底还是小保底

jilu2=0#记录是否出紫

d=input("请输入你的抽数。")

c=int(d)



def chouka_0_delete():#排除没粉球

    if c == 0:

        print("快去肝地图吧！")

    exit()

def chu5_luoji():

    global jilu1,jilu2,chu,wai,mid_z,mid_j,XH,count

    import random

    if jilu1==0:#小保底

        t=random.randint(1,2)#判断小保底歪不歪

        if t==1:#小保底不歪

            chu=chu+1

            mid_z=mid_z+1

            mid_j=0

        else:#小保底歪了

            wai=wai+1

            XH=XH+25

            jilu1=1

            mid_z=mid_z+1

            mid_j=0

    elif jilu1==1:#大保底

        jilu1=0

        chu=chu+1

        mid_z=mid_z+1

        mid_j=0



def chu4_luoji():

    import random

    global XH,jilu1,jilu2,chu,wai,mid_z,mid_j,weapen

    f = random.randint(1, 3)

    if f == 1:

        XH = XH + 5

        jilu2 = 0

        mid_j = mid_j + 1

        mid_z = 0

    else:

        weapen = weapen + 1

        XH = XH + 2

        jilu2 = 0

        mid_j = mid_j + 1

        mid_z = 0



def chouka():#抽卡系统

    global count,mid_z,mid_j,jilu2

    import random

    r = random.randint(1, 2000) # 设置随机数

    if 1 <= r <= 12: # 概率事件发生：出金

        chu5_luoji()

    if 13 <= r <= 165: # 出紫武器

        chu4_luoji()

    if 166 <= r <= 2000: # 概率事件发生，出蓝

        mid_z = mid_z + 1

        mid_j = mid_j + 1

        jilu2 = 1



chouka_0_delete()


while count<c:

    if mid_j%90==89:

        chu5_luoji()

        count=count+1

    elif mid_z%10==9:

        chu4_luoji()

        count=count+1

    elif mid_z%10!=9 and mid_j%90!=89:

        chouka()

        count=count+1

    if chu == 7:

        break



q = XH / 5

p = int(q)

m = c-count

print(f"你花了{count}抽,还剩{m}个纠缠之缘。")

print(f"剩余{XH}星辉,可兑换{p}个纠缠之缘。")

print(f"获得了{weapen}把四星武器。")

print(f"歪了{wai}次。")

print(f"出了{chu}个当期up五星角色。")